package com.itheima.methodQuote;

import com.itheima.lambda.Student;

import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;

/**
 * @program: itheima-jdk8
 * @description:
 * @author: zhanghz001
 * @create: 2021-01-07 10:08
 **/
public class MyDemo1 {
    public static void main(String[] args) {
        List<Student> students = new ArrayList<>();
        students.add(new Student(2, "张三", "M"));
        students.add(new Student(1, "李四", "M"));
        students.add(new Student(3, "王五", "F"));
        Comparator<Integer> comparator = (Comparator.comparingInt(o -> o));
        students.sort(Comparator.comparing(Student::getId));
    }
}
